<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class RoleApply extends Model
{
    /**
     * The table associated with the model.
     *
     * @var string
     */
    protected $table = 'role_apply';

    /**
     * The primary key for the model.
     *
     * @var string
     */
    protected $primaryKey = 'id';

    protected function getDateFormat()
    {
        return 'U';
    }

    public function role()
    {
        return $this->belongsTo('App\Models\Role', 'role_id', 'id');
    }

    public function user()
    {
        return $this->belongsTo('App\Models\User', 'uid', 'uid');
    }
    
    public function maker()
    {
        return $this->belongsTo(MakerApply::class, 'id', 'role_apply_id');
    }

}
